using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using MBR3Driver;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace Demo
{
    public class Program
    {
        public static void Main()
        {
            MBR3Kit MBR3 = new MBR3Kit(Pins.GPIO_PIN_D2);
            MBR3.Start();

            MBR3.OnClick += Clicked;
            MBR3.OnRelease += Released;

            while (true)
            {
            }
        }

        public static void Released(MBR3Kit sender, ClickArgs args)
        {
            if (args.ButtonClicked == CapButton.BTN1)
            {
                Debug.Print("Released BTN1");
            }
            else if (args.ButtonClicked == CapButton.BTN2)
            {
                Debug.Print("Released BTN2");
            }
            else if (args.ButtonClicked == CapButton.BTN3)
            {
                Debug.Print("Released BTN3");
            }
            else if (args.ButtonClicked == CapButton.BTN4)
            {
                Debug.Print("Released BTN4");
            }
        }

        public static void Clicked(MBR3Kit sender, ClickArgs args)
        {
            if (args.ButtonClicked == CapButton.BTN1)
            {
                Debug.Print("Clicked BTN1");
            }
            else if (args.ButtonClicked == CapButton.BTN2)
            {
                Debug.Print("Clicked BTN2");
            }
            else if (args.ButtonClicked == CapButton.BTN3)
            {
                Debug.Print("Clicked BTN3");
            }
            else if (args.ButtonClicked == CapButton.BTN4)
            {
                Debug.Print("Clicked BTN4");
            }
        }
    }
}
